<table border="0" cellspacing="0" cellpadding="0" width="550"> 
  <tr>
    <td>
	<div class="pad_r15 BotBorder">
		<?php 
			if(($ctx->type==1 ||$ctx->type==4 ||$ctx->type==5) && $ctx->details['anonymous']==1)
			{ 
				$name="Anonymous";
			} 
			if(($ctx->type==1 ||$ctx->type==4 ||$ctx->type==6) && $ctx->details['anonymous']==0)
			{
				$name=$ctx->details['first_name'];
			}
			if($ctx->type==2 ||$ctx->type==3)
			{

 $count = count($ctx->details['ExpressionsSent']);
 //echo $count.'sss';
if($count>1)
{
	$profPic = '/images/DefUser.gif';
	$otherCount = ($count-1);
	if($ctx->details['ExpressionsSent'][0]['receiver_id']!='')
	{
		
		$name = $ctx->details['ExpressionsSent'][0]['name'];
		
	} else {
		$name = $ctx->details['ExpressionsSent'][0]['receiver_email'];
	}
		$others =  'and '.$otherCount.' other(s)';
	//$count = 0;
} 
else 
{
	if($ctx->details['ExpressionsSent'][0]['photo']!='')
	{
		$profPic = '/Uploads/users/'.$ctx->details['ExpressionsSent'][0]['photo'];
	} else {
		$profPic = '/images/DefUser.gif';
	}
	if($ctx->details['ExpressionsSent'][0]['receiver_id']!='')
	{
		$name = $ctx->details['ExpressionsSent'][0]['name'];
	} else {
		$name = $ctx->details['ExpressionsSent'][0]['receiver_email'];
	}
	$others = '';
}



			}
			  
			 
		?>
	<div>
		<div class="Fright">
	<?php if($ctx->type==1 && $ctx->details['anonymous']==0) { ?>
	
			
			<?php } ?>												
			<?php if($ctx->type == 1 && $ctx->details['anonymous']!=1){ $path = '/expressions/index/inbox/1'; ?>
			<a class="BtGray" href="javascript:void(0);" onclick="changeStatustoClose(<?php echo $ctx->details['Users']['user_id'];?>,'block');">block</a>
			&nbsp;<a class="BtGray" id="reply" href="javascript:void(0);" onclick="reply('<?php echo $ctx->details['id'];?>','<?php echo $ctx->details['email'];?>');">Reply</a>
			<?php } ?>
			<?php if($ctx->type == 3){ ?><a class="BtGray" href="javascript:void(0);" onclick="sendexpression(<?php echo $ctx->expr_id;?>);">Send</a>
			<?php } ?>		
		
			<?php if($ctx->type==1){ ?>
			<?php 
			if(isset($ctx->details['MyFavorites']['status']))
			{
			$favorite_status = $ctx->details['MyFavorites']['status'];
			}
			else {
			$favorite_status = '';
			}	
			?>
			<?php if($favorite_status=="Active"){?>
			<a href="javascript:void(0);" onclick="changeStatusFavorite(<?php echo $ctx->details['id'];?>,'Inactive')"><img src="/images/FavorIconAct.png" alt="Favorite" title="Favorite" /></a>
			<? } else {?>
			<a href="javascript:void(0);" onclick="changeStatusFavorite(<?php echo $ctx->details['id'];?>,'Active')"><img src="/images/FavorIconNor.png" alt="Favorite" title="Favorite" /></a>
			<? } ?>
			<? } ?>
			<a href="javascript:void(0);" onclick="changeStatustoClose(<?php echo $ctx->details['id'];?>,'close');"><img src="/images/CloseIcon.png" alt="Close" border="0" class="img_inline" title="Delete"/></a>
			<a href="javascript:void(0);" onclick="closeDiv();"> Close </a>
		</div>
	<div class="clear"></div>
		</div>
	<div class="pad_t15"></div>
	<p class="txt18"><?php echo $ctx->details['subject']; ?></p>
	<p class="UName" style="padding:10px 0px;"><strong><?php echo $name; ?>&nbsp;<?php echo @$others;?></strong></p>
			
	</div>
	

	<div class="clear"></div>
	<div class="pad_t15">
	<p><?php echo $ctx->details['message']; ?></p>
	<?php foreach($ctx->details['ExpressionsAttachements'] as $attachs) { ?>
	<?php $files = explode('_-_',$attachs['attachments']); ?>
	<p class="pad_t15"><a href="/Uploads/photos/<?php echo $attachs['attachments']; ?>" target="_blank"> &nbsp;<img src="/images/AttachIcon.png" alt="Attachment" border="0" align="absmiddle" title="Attachment" />&nbsp;<?php echo $files[1]; ?></a></p>
	 <?php } ?>
	</div>
	</td>
  </tr>
</table>